import request from "@/util/request";
import type { SocBard, SocBardVO } from "./type";
import type { PageType } from '@/api/type'

enum API {
    BARD_PAGE_URL = '/social/bard/page',
    BARD_URL = '/social/bard'
}

export function reqGetBardList(params: object) {
    return request<PageType<SocBard>>({
        url: API.BARD_PAGE_URL,
        method: 'get',
        params
    })
}

export function reqCreateBard(data: SocBard) {
    return request<PageType<SocBard>>({
        url: API.BARD_URL,
        method: 'post',
        data
    })
}
export function reqUpdateBard(data: SocBard) {
    return request<PageType<SocBard>>({
        url: API.BARD_URL,
        method: 'put',
        data
    })
}
export function reqDeleteBard(bardId: string) {
    return request<PageType<SocBard>>({
        url: API.BARD_URL + "/" + bardId,
        method: 'delete',
    })
}

export function reqGetBardById(bardId: string) {
    return request<SocBardVO>({
        url: API.BARD_URL + "/" + bardId,
        method: 'get',
    })
}
